home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Atari Mega Archive 1
/
Atari Mega Archive - Volume 1.iso
/
mint
/
lib
/
mntlib44.zoo
/
mntlib
/
memchr.c
< prev
next >
Wrap
C/C++ Source or Header
|
1993-05-23
|
400b
|
28 lines
/* from Henry Spencer's stringlib */
#include <stddef.h>
#include <string.h>
/*
* memchr - search for a byte
*/
void *
memchr(s, ucharwanted, size)
const void * s;
int ucharwanted;
size_t size;
{
register const char *scan;
register size_t n;
scan = (const char *) s;
for (n = size; n > 0; n--)
if (*scan == (char) ucharwanted)
return((void *)scan);
else
scan++;
return(NULL);
}